<template>
    <div class="section-wrap" id="register">
        <div class="headerBox">
            <div class="header">
                <x-icon type="ios-arrow-left" size="" class="icon-white" @click="goBack"></x-icon>
                违章登记
            </div>
        </div>
        <div class="form-section" style="margin-top: 40px;margin-bottom: 0;">
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>项目名称</label>
                </div>
                <div class="input_div" @click="getCompany">
                    <input type="text" v-model="info.departName" disabled placeholder="请选择"><x-icon type="ios-arrow-right" size="22" class="icon-right" ></x-icon>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>项目管理单位</label>
                </div>
                <div class="input_div">
                    <input type="text" v-model="info.panrentDepartName" disabled>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>业主项目经理</label>
                </div>
                <div class="input_div">
                    <input type="text" v-model="info.charge" disabled>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章登记人</label>
                </div>
                <div class="input_div">
                    <input type="text" v-model="info.weizRegisterPerson" disabled>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章时间</label>
                </div>
                <group style="margin-right:-20px" class="gt">
                    <datetime v-model="end" format='YYYY-MM-DD' ></datetime>
                </group>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章人员名称</label>
                </div>
                <div class="input_div" @click="classValue=true">
                    <input type="text" v-model="info.weizPersonName" disabled placeholder="请输入"><x-icon type="ios-arrow-right" size="22" class="icon-right" ></x-icon>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章地点</label>
                </div>
                <div class="input_div" @click="classValue2=true">
                    <input type="text" v-model="info.weizAddress" disabled placeholder="请输入"><x-icon type="ios-arrow-right" size="22" class="icon-right" ></x-icon>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label class="kk">违章人员所属参建单位</label>
                </div>
                <div class="input_div" @click="getCompany2()">
                    <input type="text" v-model="info.weizPersonDepartName" disabled placeholder="请选择">
                    <!-- <x-icon type="ios-arrow-right" size="22" class="icon-right" ></x-icon> -->
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章编号</label>
                </div>
                <div class="input_div">
                    <input type="text" v-model="info.weizNo" disabled>
                </div>
            </div>
            <div class="imgDiv">
                <div class="left_label">违章图片</div>
                <div class="upload-wrap">
                    <upload
                        :imgList="info.projectImgList"
                        @setFormData="setYSFormData"
                    ></upload>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章现象</label>
                </div>
                <div class="input_div" @click="examinedUnits2()">
                    <input type="text" v-model="info.weizPhenItemListName" disabled placeholder="请选择"><x-icon type="ios-arrow-right" size="22" class="icon-right" ></x-icon>
                </div>
            </div>

            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章标准编号</label>
                </div>
                <div class="input_div">
                    <input type="text" v-model="info.weizPhenItemListNo" disabled>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章整改开始时间</label>
                </div>
                <!-- <div class="input_div">
                    <input type="text" v-model="info.weizAbarbeitungEndDate" disabled>
                </div> -->
                <group style="margin-right:-20px" class="gt">
                    <datetime v-model="end2" format='YYYY-MM-DD HH:mm:00' :start-date="startDate"></datetime>
                </group>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章整改结束时间</label>
                </div>
                <!-- <div class="input_div">
                    <input type="text" v-model="info.weizAbarbeitungEndDate" disabled>
                </div> -->
                <group style="margin-right:-20px" class="gt">
                    <datetime v-model="end3" format='YYYY-MM-DD HH:mm:00' :start-date="startDate"></datetime>
                </group>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章验收单位</label>
                </div>
                <div class="input_div" @click="examinedUnits()">
                    <input type="text" v-model="info.weizCheckDepartName" disabled placeholder="请选择"><x-icon type="ios-arrow-right" size="22" class="icon-right" ></x-icon>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章验收人员</label>
                </div>
                <div class="input_div" @click="getcheckuser">
                    <input type="text" v-model="info.weizCheckPersonName" disabled placeholder="请选择"><x-icon type="ios-arrow-right" size="22" class="icon-right" ></x-icon>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章整改人</label>
                </div>
                <div class="input_div" @click="getzguser">
                    <input type="text" v-model="info.weizCheckZrrName" disabled placeholder="请选择"><x-icon type="ios-arrow-right" size="22" class="icon-right" ></x-icon>
                </div>
            </div>
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>违章现象抄送人</label>
                </div>
                <div class="input_div" @click="getGroup()">
                    <input type="text"
                    placeholder="请选择"
                    disabled 
                    v-model="info.copytoPersonName">
                    <x-icon type="ios-arrow-right" size="22" class="icon-right"></x-icon>
                </div>
            </div>
            <!-- 新增选项 -->
            <div class="model" v-for="(item,index) in info.rectifyList" :key="index">
                <!-- 违章整改信息 查-->
                <div v-if='item.rectifystatus==1'>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label style="color:#1545d2;font-weight: bold;">违章整改信息第({{index+1}})</label>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>违章整改责任人</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="info.weizCheckZrrName" disabled placeholder="请选择">
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改完成时间</label>
                        </div>
                        <group style="margin-right:-20px">
                            <input type="text" v-model="item.rectifydate" disabled style="padding-right:20px">
                        </group>
                    </div>
                    <div class="imgDiv">
                        <div class="left_label">整改后图片</div>
                        <div class="imgUl" >
                            <img :src="data.url" alt="" v-for="(data,index) in item.rectifyImgList" :key="index">
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改情况回复</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="item.rectifydateRemark" disabled placeholder="暂无...">
                        </div>
                    </div>
                </div>
                <!-- 违章整改信息 改-->
<!--                 <div v-if="info.status==1 && item.rectifystatus==0">
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label style="color:#1545d2;font-weight: bold;">违章整改信息第({{index+1}})次</label>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>违章整改责任人</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="info.weizCheckZrrName" disabled placeholder="请选择">
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改完成时间</label>
                        </div>
                        <group style="margin-right:-20px" >
                            <datetime v-model="end" format='YYYY-MM-DD HH:mm' @on-change='time' :start-date="startDate"></datetime>
                        </group>
                    </div>
                     <div class="form-item form-item-style2">
                        <div class="label-title space-between">
                            <label>违章图片</label>
                        </div>
                        <div class="upload-wrap">
                            <upload 
                            v-if="item.rectifyImgList.length>0"
                            :imgList="item.rectifyImgList"></upload>
                            <upload v-else
                            :imgList="item.rectifyImgList"
                            @setFormData="setYSFormData"
                            ></upload>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改情况回复</label>
                        </div>
                        <div class="input_div" @click="classValue=true">
                            <input type="text" v-model="rectifydateRemark" disabled placeholder="请输入">
                        </div>
                    </div>
                </div> -->
                <!-- 违章验收信息 查-->
                <div v-if='item.checkstatus==1'>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label style="color:#1545d2;font-weight: bold;">违章验收信息第({{index+1}})次</label>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>违章验收人员</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="info.weizCheckPersonName" disabled placeholder="请选择">
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>验收时间</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="item.checkdate" disabled>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>违章验收结论</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="item.checkResults" disabled>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>违章验收方式</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="item.checkMode" disabled>
                        </div>
                    </div>
                    <div class="imgDiv">
                        <div class="left_label">验收图片</div>
                        <div class="imgUl" >
                            <img :src="data.url" alt="" v-for="(data,index) in item.checkImgList" :key="index">
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>违章验收意见</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="item.checkIdea" disabled placeholder="请选择">
                        </div>
                    </div>
                </div>
                <!-- 违章验收信息 改 -->
<!--                 <div v-if="info.status==2 && item.checkstatus==0">
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label style="color:#1545d2;font-weight: bold;">2违章验收信息第({{index+1}})次</label>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>违章整改责任人</label>
                        </div>
                        <div class="input_div">
                            <input type="text" v-model="info.weizCheckZrrName" disabled placeholder="请选择">
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改完成时间</label>
                        </div>
                        <group style="margin-right:-20px">
                            <datetime v-model="end" :start-date="startDate" format='YYYY-MM-DD HH:mm'></datetime>
                        </group>
                    </div>
                    <div class="imgDiv">
                        <div class="left_label">整改后图片</div>
                        <div class="imgUl" >
                            <img :src="data.url" alt="" v-for="(data,index) in item.checkImgList" :key="index">
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>整改情况回复</label>
                        </div>
                        <div class="input_div" @click="$router.push('./demo2')">
                            <input type="text" v-model="item.weizCheckRemark" disabled placeholder="请选择">
                        </div>
                    </div>
                </div> -->
            </div>
            <div class="btns_div" >
                <a class="submitBtn" @click="enter">提 交</a>
                <a class="cancelBtn" @click="goBack">取消</a>
            </div>
        </div>
        <!-- 输入弹窗 -->
        <div v-transfer-dom>
            <popup v-model="classValue" width="100%" height="300px">
                <group>
                     <x-textarea :max="50" name="description" placeholder="请输入违章人员名称" v-model="weizPersonName" id="tt"></x-textarea>
                </group>
                <p class="transfer_p"><span @click="ent">确定</span> <em @click="weizPersonName=''">清空</em></p>
            </popup>
            <popup v-model="classValue2" width="100%" height="300px">
                <group>
                     <x-textarea :max="50" name="description" placeholder="请输入违章地点" v-model="weizAddress" id="tt"></x-textarea>
                </group>
                <p class="transfer_p"><span @click="ent2">确定</span> <em @click="weizAddress=''">清空</em></p>
            </popup>
            <popup v-model="classValue3" width="100%" height="300px">
                <group>
                     <x-textarea :max="200" name="description" placeholder="请输入违章人员所属参建单位" v-model="weizPersonDepartName" id="tt"></x-textarea>
                </group>
                <p class="transfer_p"><span @click="ent3">确定</span> <em @click="weizPersonDepartName=''">清空</em></p>
            </popup>            
            <popup v-model="classValue4" width="100%" height="300px">
                <group>
                     <x-textarea :max="200" name="description" placeholder="请输入违章地点" v-model="checkArea" id="tt"></x-textarea>
                </group>
                <p class="transfer_p"><span @click="ent">确定</span> <em>清空</em></p>
            </popup>
            <popup v-model="classValue5" width="100%">
                <ztree
                    :data="data"
                    @nodeClick="nodeClick"
                    :name="'departName'"
                ></ztree>
            </popup>
            <popup v-model="classValue6" width="100%">
                     <ztreeuser  :data="datacheck"
            @nodeClick="nodeClickcheck"
            :show-checkBox="true"
            :name="'departName'">
            </ztreeuser>
            </popup>
            <popup v-model="classValuenew" width="100%">
                     <ztreeuser  :data="datazg"
            @nodeClick="nodeClickzg"
            :show-checkBox="true"
            :name="'departName'">
            </ztreeuser>
            </popup>
            <popup v-model="classValue7" width="100%" height="70%">
                <ztree2
                    :data="data2"
                    @nodeClick="nodeClick7"
                    :name="'departName'"
                    style="margin-top:40px"
                    >
                </ztree2>
            </popup>
            <popup v-model="classValueCom" width="100%">
                <ztree
                :data="dataCom"
                @nodeClick="nodeClickCom"
                :name="'departName'"
                ></ztree>
            </popup>
            <popup v-model="classValue8" width="100%" height="70%">
                <div class="alertMain">
                    <h1>{{title}} </h1>
                    <ul v-for="(item,index) in list" :key="index">
                        <li @click="chooese(item)">{{item.weizPhenItem}} </li>
                    </ul>
                </div>
            </popup>
            <popup v-model="classValue9" width="100%">
                <select-depart @nodeClick='selectedDepart'></select-depart>
            </popup>
            <popup v-model="classValueCom2" width="100%">
                <ztree
                :data="dataCom2"
                @nodeClick="nodeClickCom2"
                :name="'departName'"

                ></ztree>
            </popup>
            <popup v-model="classValuecs" width="100%" >
                <select-user :data="datacs" @selectUser='selectUser'></select-user>
            </popup>
        </div>
    </div>
</template>
<script>
import selectDepart from "@commonComponents/selectDepart/selectDepart";
import ztree2 from "./tree/index"
import ztreeuser from "./treeUser/index"
import selectUser from "@commonComponents/selectDepartUser/selectUser";
import ztree from "@commonComponents/tree"
import upload from "@/commonComponents/upload/upload";
import formatDate from "../../utils/formatDate";
import {TransferDom,Popup,XTextarea} from 'vux'
export default {
  data() {
    return {
       uploadLength:'',
       startDate:'',
       weizPersonName:'',
       weizAddress:'',
       weizPersonDepartName:'',
       end:'',
       end2:'',
       end3:'',
       params: {
        id:'',
       },
       info:{
           rectifyList:{
               rectifydate:'',
               rectifydateRemark:'',
               
              }
       },
       classValueCom:false,
       classValue:false,
       classValue2:false,
       classValue3:false,
       classValue4:false,
       classValue5:false,
       classValue6:false,
       classValuenew:false,
       classValue7:false,
       classValue8:false,
       classValue9:false,
       classValuecs:false,
       checkArea:'',
       imgList:[],
       rectifydateRemark:'',
       num:false,
    //    subBtn:true,
       data:[],
       data2:[],
       datacs:[],
       datacheck:[],
       datazg:[],       
       dataCom: [],
       list:[],
       pamars:{
           classifyID:'',
           skipCount:'0',
           maxResultCount:'1000'
       },
       title:'',
       classValueCom2:false,
        dataCom2:[],
    };
  },
  components: {
      ztreeuser,
      ztree,
      ztree2,
      Popup,
      XTextarea,
      upload,
      selectUser,
      selectDepart,
  },
  directives:{
      TransferDom
  },
  created() {
    this.$store.state.illegalType =3
    this.getInfo();
    var myDate = new Date(); //实例一个时间对象；
    myDate.getFullYear();   //获取系统的年；
    myDate.getMonth()+1;   //获取系统月份，由于月份是从0开始计算，所以要加1
    var m =myDate.getMonth()+1<10?'0'+(myDate.getMonth()+1):myDate.getMonth()+1
    myDate.getDate(); // 获取系统日，
    var day = myDate.getDate()<10?'0'+myDate.getDate():myDate.getDate()
    var hours = myDate.getHours()<10?'0'+myDate.getHours():myDate.getHours()
    var min =myDate.getMinutes()<10?'0'+myDate.getMinutes():myDate.getMinutes()
    this.startDate=myDate.getFullYear()+'-'+m+'-'+day
  },
  mounted(){
        // 人员接口
        this.$axiosAjax.getDivision({classifyId: ''}).then((res) => {
            if (res.data.success == true) {
                this.datacs = res.data.result
            }
        }).catch((err) => {
            console.log(err)
            }
        )
        let that = this;
        this.$bridge.registerHandler("setToken", function(data) {
                         that.$store.state.Authorization =
          "Bearer " + data;
    that.$store.state.illegalType =3
    that.getInfo();
        });

        this.connectWebViewJavascriptBridge(function(bridge) {
            bridge.registerHandler("setToken", function(data) {
                             that.$store.state.Authorization =
          "Bearer " + data;
    that.$store.state.illegalType =3
    that.getInfo();
                
            });
        });

    },
  methods: {
    getGroup () {
        this.classValuecs = true;
    },
    // 抄送人员选择
    selectUser(data) {
        // 抄送人
        this.info.copytoPersonName=data.userName
        this.info.copytoPersonId=data.id
        this.classValuecs = false
    },
      goBack() {
        this.$bridge.callHandler({
              type: 'closePage',
              data: {}
            });
      },
    connectWebViewJavascriptBridge(callback) {
        if (window.WebViewJavascriptBridge) {
            callback(WebViewJavascriptBridge);
        } else {
            document.addEventListener(
            "WebViewJavascriptBridgeReady",
            function() {
                callback(WebViewJavascriptBridge);
            },
            false
            );
        }
    },
    time(){
        this.num=true
    },
    chooese(val){
        console.log(val,2)
        if (val){
            this.info.weizPhenItemListNo=val.weizNo
            this.info.weizPhenItemListName=val.weizPhenItem
            this.classValue8=false
        }
    },
    // 上传组件传过来的
    setYSFormData (uploadLength, file) {
      var ids = []
      for(var k of file){
          ids.push(k.id)
      }
      this.info.fileList=ids
      this.uploadLength = uploadLength;
    },
    ent(){
        this.info.weizPersonName=this.weizPersonName
        this.classValue=false
    },
    ent2(){
        this.info.weizAddress=this.weizAddress
        this.classValue2=false
    },
    ent3(){
        this.info.weizPersonDepartName=this.weizPersonDepartName
        this.classValue3=false
    },
    selectedDepart(data) {
        console.log(data,1)
        this.info.departName=data.departName
        this.classValue9 = false;
        this.getInfo(data.id)
                
    },

    // 初始化数据
    getInfo(val) {
       this.params.id=this.$route.query.id; //id
       this.params.departId = val;
       this.$axiosAjax.haveRegBreakGet(this.params).then(res => {
          if (res.data.success == true) {
             this.info = res.data.result;
             this.rectifyListArr=res.data.result.rectifyList
            this.end=this.info.weizDate.substring(0,10)
            // this.end2=this.info.weizAbarbeitungEndDate.substring(0,10)
            console.log(this.info.weizAbarbeitungEndDate,12)
             for (var j of res.data.result.rectifyList){
                if(res.data.result.status==1&&j.rectifystatus==0){
                    this.end=j.rectifydate
                    this.rectifydateRemark=j.rectifydateRemark
                    // this.subBtn=true
                } else {
                    // this.subBtn=false
                }
                if (j.rectifystatus==0){
                    this.$store.state.illegalDepartId =j.id
                }
             } 
          }
        }).catch(err => {})
    },
    // 提交
    enter(){
        var myDate = new Date(); //实例一个时间对象；
        var hours = myDate.getHours()<10?'0'+myDate.getHours():myDate.getHours()
        var min =myDate.getMinutes()<10?'0'+myDate.getMinutes():myDate.getMinutes()
        this.info.rocordId = this.$route.query.rocordId;
        this.info.weizDate=this.end+' 00:00:00'
        this.info.weizAbarbeitungStartDate=this.end2
        this.info.weizAbarbeitungEndDate=this.end3
        if(this.info.rectifyList!=null&&this.info.rectifyList) {
            for (var k of this.info.rectifyList){
                if (k.rectifystatus==0){
                    k.rectifydateRemark=this.rectifydateRemark
                    k.rectifydate=this.end+' '+hours+':'+min+':00'
                }
            }
        }
        if (this.info.weizCheckZrrName&&this.info.departName&&this.info.weizDate&&this.info.weizPersonName&&this.info.weizAddress&&this.info.weizPersonDepartName&&this.info.fileList&&this.info.weizPhenItemListName&&this.end2&&this.end3&&this.info.weizCheckDepartName&&this.info.weizCheckPersonName){
            this.info.status=this.info.status+1
            this.$axiosAjax.saveWeizregister(this.info).then(res => {
                console.log(res.data)
              if (res.data.success == true) {
                //   this.$router.push('../quantization/recordDetails')
                this.$bridge.callHandler({
                    type: 'closePage',
                    data: {}
                    });
              }
            }).catch(err => {
                console.log(err)
            })
        }else if(!this.info.departName){
            this.$vux.toast.text('项目名称必填')
        }else if(!this.info.weizDate){
            this.$vux.toast.text('违章时间必填')
        }else if(!this.info.weizPersonName){
            this.$vux.toast.text('违章人员必填')
        }else if(!this.info.weizAddress){
            this.$vux.toast.text('违章地点必填')
        }else if(!this.info.weizPersonDepartName){
            this.$vux.toast.text('违章人员所属参建单位必填')
        }else if(!this.info.fileList){
            this.$vux.toast.text('违章时图片必填')
        }else if(!this.info.weizPhenItemListName){
            this.$vux.toast.text('违章现象必填')
        }else if(!this.end2){
            this.$vux.toast.text('违章整改开始时间必填')
        }else if(!this.end3){
            this.$vux.toast.text('违章整改结束时间必填')
        }else if(!this.info.weizCheckDepartName){
            this.$vux.toast.text('违章验收单位必填')
        }else if(!this.info.weizCheckPersonName){
            this.$vux.toast.text('违章验收人员必填')
        }else if(!this.info.weizCheckZrrName){
            this.$vux.toast.text('违章整改人必填')
        }
    },
    // 保存
    save(){
        this.$axiosAjax.saveWeizregister(this.info).then(res => {
            console.log(res,111)
        if (res.data.success == true) {
            this.$router.push('../quantization/recordDetails')
        }
        }).catch(err => {
            console.log(err)
        })
    },
    // 单位树数据
    examinedUnits(){  
        this.$axiosAjax.examinedUnits({parentId:this.$store.state.departId}).then((res) => {
          if(res.data.success==true){
		    this.classValue5=true;
            this.data=res.data.result;
          }
        }).catch(
          (err)=>{

          }
        )
    },
    // 单位树数据
    examinedUnits2(){  
          this.$axiosAjax.weizPhenoList({parentId:0}).then((res) => {
            if(res.data.success==true){
                this.classValue7=true
                this.data2=res.data.result.data;
            }
          }).catch((err)=>{
            console.log(err)
          })
    },
    // 点击单位树
    nodeClick(item){
        this.info.weizCheckDepartName=item.departName
        this.classValue5=false
    },
    // 点击人员选择的树
    // selectUser(data) {
    //     console.log(data,12)
    //     this.info.weizCheckPersonName=data.userName
    //     this.classValue6=false
    // },
    selectUserNew(data) {
        console.log(data,12)
        this.info.weizCheckZrrName=data.userName
        this.info.weizCheckZrrId =data.userAccount
        this.classValuenew=false
    },
    // 点击单位树2
    nodeClick7(item){
        this.title=item.weizName
        this.classValue8=true
        this.classValue7=false
        
        var pamars={
            classifyID:item.id,
            skipCount:'0',
            maxResultCount:'1000'
        }
        this.$axiosAjax.phenomenonList(pamars).then((res) => {
            if(res.data.success==true){
                this.list=res.data.result.items;
            }
          }).catch((err)=>{
            console.log(err)
          })
    },
      getCompany() {
       this.examinedUnitsCom();
      },
      examinedUnitsCom() {
        this.$axiosAjax.examinedUnits({parentId: this.$store.state.departId}).then((res) => {
          if (res.data.success == true) {
             this.classValueCom = true;
             this.dataCom = res.data.result;
          }
        }).catch(
          (err) => {

          }
        )

      },
      nodeClickCom(item) {
        if (
          item.departType == 6 ||
          item.departType == 7 ||
          item.departType == 8
        ) {
            this.info.departName=item.departName
            this.classValueCom = false;
            this.getInfo(item.id)
        } else {
          this.$vux.text("只能选择项目部");
        }
      },
      getCompany2() {
        var arr =[]
        this.$axiosAjax.getBuildRelationProjectWZ().then(res => {
            if (res.data.success == true) {
            this.classValueCom2 = true;
            arr.push(res.data.result);
            }
        })
        .catch(err => {});
        this.dataCom2=arr;
      },
      nodeClickCom2(item) {
        if (item.parentId == "-1") {
            this.$vux.toast.text("请选择具体单位层级！");
        } else {
            this.info.weizPersonDepartName=item.departName
            this.info.weizPersonDepartId=item.id
            this.classValueCom2 = false;
        }
      },
      getcheckuser() {
       this.examinedUnitscheck();
      },
      examinedUnitscheck() {
        this.$axiosAjax.examinedUnits({parentId: this.$store.state.departId}).then((res) => {
          if (res.data.success == true) {
             this.classValue6 = true;
             this.datacheck = res.data.result;
            console.log(this.data);
          }
        }).catch(
          (err) => {

          }
        )

      },
      nodeClickcheck(item) {
          this.info.weizCheckPersonId = item.userAccount
          this.info.weizCheckPersonName = item.userName
          this.classValue6=false;
    //       var that= this
    //   this.$axiosAjax
    //     .getUserList({ departId: item.id, skipCount: 0, maxResultCount: 100 })
    //     .then(res => {
    //       if (res.data.success == true) {
    //         that.datacheck.users = res.data.result.items;
    //       }
    //     })
    //     .catch(err => {});
      },
      getzguser() {
       this.examinedUnitszg();
      },
      examinedUnitszg() {
        this.$axiosAjax.examinedUnits({parentId: this.$store.state.departId}).then((res) => {
          if (res.data.success == true) {
             this.classValuenew = true;
             this.datazg = res.data.result;
          }
        }).catch(
          (err) => {

          }
        )
      },
      nodeClickzg(item) {
          this.info.weizCheckZrrId = item.userAccount
          this.info.weizCheckZrrName = item.userName
          this.classValuenew=false;
    //       var that= this
    //   this.$axiosAjax
    //     .getUserList({ departId: item.id, skipCount: 0, maxResultCount: 100 })
    //     .then(res => {
    //       if (res.data.success == true) {
    //         that.datacheck.users = res.data.result.items;
    //       }
    //     })
    //     .catch(err => {});
      },
  },

};
</script>
<style lang="less" socped>
#register{
    position: relative;
    .form-item-style1{
      height: 55px;
      line-height: 55px;
    }
    .kk{
        width: 140px;
    }
    .gt .vux-cell-value{
        margin-top: -5px!important;
    }
    .form-item {
        margin-left: 0;
        padding-left: 20px;
        label {
            font-weight: normal;
        }
        .input_div {
            input{
                height: 40px;
                line-height: 40px;
                color: #333;
            }
            > span:first-child {
            margin-left: 0;
            }
            .vux-x-icon {
                fill: #333;
                float: right;
                margin-right: -20px;
                margin-top: 17px;
            }
        }
    }
    .form-item .vux-cell-value{
        height: 55px;
        line-height: 55px;
    }
    .imgDiv{
        border-bottom: 1px solid rgb(239, 239, 244);
        padding: 0 20px;
        .left_label{
            height: 40px;
            font-size: 14px;
            line-height: 40px;
        }
        .imgUl{
            width: 100%;
            margin-bottom: 6px;
            img{
                width: 50px;
                height: 50px;
                margin: 2px 2px 0 0;
            }
        }
    }
    .btns_div {
        background: #ebeef2;
        padding: 30px 20px 55px;
        justify-content: space-between;
        display: flex;
        a {
            height: 40px;
            border-radius: 20px;
            display: inline-block;
            width: 140px;
            text-align: center;
            line-height: 40px;
            color: #fff;
        }
        .submitBtn {
            background: #469b7a;
        }
        .cancelBtn {
            background: #15bc84;
        }
    }
    .form-item .weui-cell_access .weui-cell__ft::after{
        margin-top: -5px;
    }
    .vux-cell-primary{
        height: 40px;
        border-top:0!important;
        .vux-cell-value{
            margin-top: 0;
        }
    }
    .form-item .vux-no-group-title{
        height: 40px!important;
    }
}
.alertMain{
    height: 100%;
    overflow-y: scroll;
    background-color: #fff;
    padding: 0 20px;
    h1{
        width: 100%;
        font-size: 16px;
        height: 40px;
        line-height: 40px;
        font-weight: bold;
        border-bottom: 1px solid #dcdada;
    }
    ul{
        li{
            border-bottom: 1px solid #dcdada;
            padding:10px 20px;
            line-height: 20px;
        }
    }
}
    .transfer_p{
        padding: 10px 20px;
        height: 30px;
        span,em{
            width: 60px;
            height: 30px;
            text-align: center;
            line-height: 30px;
            font-size: 16px;
            border-radius: 5px;
            color: #fff;
        }
        span{
            float: left;
            background-color:#2abf72;
        }
        em{
            float: right;
            background-color: #ceaa6c;
        }
    }
    .weui-cell__bd{
        height: 200px!important;
    }
    #tt {
        background-color: #eee;
        .weui-cell__bd .weui-textarea{
            height: 180px!important;
            background-color: #fff;
        }
    }
</style>
